package ooday09;


//getter和setter得演示
public class GetterSetterDemo {
    public static void main(String[] args) {
        Student zs= new Student();
        zs.setName("zhangsan");
        zs.setAge(25);
        System.out.println(zs.getName());
        System.out.println(zs.getAge());

        Student ls=new Student();
        ls.setName("lisi");
        ls.setAge(26);
        System.out.println(ls.getName());
        System.out.println(ls.getAge());


    }
}

class Student {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age=age;
    }

}